//
//  UIColor+String.m
//  FangTianXia
//
//  Created by 曹想 on 16/11/10.
//  Copyright © 2016年 ShangHaDiSongWangLuoKeJi. All rights reserved.
//

#import "UIColor+String.h"

@implementation UIColor (String)

+(UIColor *)hexStringColor:(NSString *)strColor{
    
    unsigned int red,green,blue;
    
    NSRange range;
    range.length = 2;
    range.location = 0;
    [[NSScanner scannerWithString:[strColor substringWithRange:range]]scanHexInt:&red];
    
    range.length = 2;
    range.location = 2;
    [[NSScanner scannerWithString:[strColor substringWithRange:range]]scanHexInt:&green];
    
    range.length = 2;
    range.location = 4;
    [[NSScanner scannerWithString:[strColor substringWithRange:range]]scanHexInt:&blue];
    return [UIColor colorWithRed:red/255.f green:green/255.f blue:blue/255.f alpha:1.0f];
}

@end
